function clone(data) {
  let result = {}
  const keys = [
    ...Object.getOwnPropertyNames(data),
    ...Object.getOwnPropertySymbols(data),
  ]
  if (!keys.length) return data
  keys.forEach((key) => {
    let item = data[key]
    if (typeof item === 'object' && item) {
      result[key] = clone(item)
    } else {
      result[key] = item
    }
  })
  return result
}
